FROM openjdk:8-jdk-alpine
LABEL maintainer "Bitnami <containers@bitnami.com>"

ENV HOME="/" \
    OS_ARCH="amd64" \
    OS_FLAVOUR="debian-10" \
    OS_NAME="linux"

ENV DOWNLOAD_URL="https://downloads.bitnami.com/files/stacksmith"

COPY prebuildfs /

# Install required system packages and dependencies
RUN install_packages curl gzip tar python3-pip gosu
RUN pip3 install yq
#RUN . /usr/local/scripts/libcomponent.sh && component_unpack "yq-3.4.1-0-linux-amd64-debian-10" ${DOWNLOAD_URL} "tar.gz" --checksum c88c76a7b5214407821771e5fc340f0320d5ded19eada938629603a982b8b640
RUN . /usr/local/scripts/libcomponent.sh && component_unpack "java-11.0.11-0-linux-amd64-debian-10" ${DOWNLOAD_URL} "tar.gz" --checksum 8cf28afc1090b0fec1ad841012ead25b59d2d5f4212742c3d62e6007ef57850b
#RUN . /usr/local/scripts/libcomponent.sh && component_unpack "gosu-1.13.0-0-linux-amd64-debian-10" ${DOWNLOAD_URL} "tar.gz" --checksum fd7257c2736164d02832dbf72e2c1ed9d875bf3e32f0988520796bc503330129

# 增加locales支持，并设置默认为 UTF-8；配置时区默认为 Shanghai
RUN set -eux; \
	sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen; \
	sed -i -e 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen; \
	locale-gen; \
	update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_MESSAGES=POSIX; \
	dpkg-reconfigure -f noninteractive locales; \
	ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; \
	dpkg-reconfigure -f noninteractive tzdata;